package com.news.news.service;


import com.news.news.dao.UserLikeDao;
import com.news.news.modle.Like;
import com.news.news.util.JWTUtil;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

@Service
@Transactional
public class UserLikeService {
    @Resource
    UserLikeDao likeDao;
    public List<Like> likeList(String token) {
        Integer id= JWTUtil.getTokenInfo(token).getClaim("id").asInt();
        ArrayList<Like> arrayList=likeDao.likeList(id);
        return arrayList;
    }
}
